package com.yic.module.base.api.brand;

import cn.hutool.core.util.ObjectUtil;
import com.yic.module.base.api.brand.dto.BrandRespDTO;
import com.yic.module.base.convert.brand.BrandConvert;
import com.yic.module.base.dal.dataobject.brand.BrandDO;
import com.yic.module.base.service.brand.BrandService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName BrandApiImpl
 * @Description 品牌api实现类
 * @Author Lijx
 * @Date 2023/11/6 17:06
 * @Version 1.0
 */
@Service
public class BrandApiImpl implements BrandApi {

    @Resource
    private BrandService brandService;

    @Override
    public BrandRespDTO getBrand(Long id) {
        if (ObjectUtil.isNull(id)){
            return null;
        }
        BrandDO brand = brandService.getBrand(id);
        return BrandConvert.INSTANCE.convert01(brand);
    }
}
